package com.cliente;

import com.example.conver.R;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class Menu extends Activity {

	TextView token;
	Button exit, findcliente, addcliente;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu);
		token = (TextView) findViewById(R.id.Token);
		exit = (Button) findViewById(R.id.exit);
		findcliente = (Button) findViewById(R.id.findbuttons);
		addcliente = (Button) findViewById(R.id.encr);

		// esto muestra el token en el menu, es un metodo solo para probar esta
		// funcion
		SharedPreferences prefs = getSharedPreferences("session",Context.MODE_PRIVATE);
		//token.setText("" + prefs.getString("RETURN", ""));

		// boton salir
		exit.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Intent main = new Intent(Menu.this, MainActivity.class);
				startActivity(main);
				finish();
			}
		});

		// boton listar
		findcliente.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Intent main = new Intent(Menu.this, FindLista.class);
				startActivity(main);
				
			}
		});

		// boton agregar cliente
		addcliente.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Intent main = new Intent(Menu.this, Encriptar.class);
				startActivity(main);
				
			}
		});

	}

}
